Image encoding/decoding method and device using same

ABSTRACT

The image decoding method according to the present invention comprises the steps of: determining the availability of a block adjacent to a current block; configuring a merge candidate list for the current block on the basis of the result of the determined availability; and performing motion compensation for the current block on the basis of the merge candidate list, wherein the step of determining availability comprises the steps of inducing block availability information on the adjacent block and inducing the availability of motion information on the adjacent block, and the step of determining the availability of the adjacent block is such that when there is more than one adjacent block, the availability of adjacent blocks can be determined in accordance with a predetermined order restriction.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of application Ser. No. 14/390,135having a 371(c) date of Oct. 2, 2014, which is now U.S. Pat. No.10,506,253 issued Dec. 10, 2019, which is a U.S. national stageapplication of International Application No. PCT/KR2013/009122 filed onOct. 11, 2013, which claims the benefit of Korean Application No.10-2012-0113851 filed on Oct. 12, 2012, and Korean Application No.10-2013-0121330 filed on Oct. 11, 2013, in the Korean IntellectualProperty Office, the entire disclosures of which are incorporated hereinby reference for all purposes.

TECHNICAL FIELD

The present invention relates to video encoding and decoding processing,and more particularly, to a video encoding and decoding method and anapparatus using the same that configure a motion candidate list.

BACKGROUND ART

In recent years, as a broadcasting service having high definitionresolution (1280×1024 or 1920 or 1080) has been extended globally aswell as domestically, a lot of users have been familiar with ahigh-resolution, high-definition video now and a lot of institutionshave spurred development of a next-generation video apparatus by keepingup therewith. Further, moving picture standardization groups haveperceived the necessity of compression technology of ahigher-resolution, higher-definition video with an increase of a concernabout ultra high definition (UHD) having four times higher resolutionthan an HDTV as well as the HDTV. In addition, a new standard isurgently needed, which can acquire a lot of gains in terms of afrequency band or storage while maintaining the same definition throughhigher compression efficiency than H.264/AVC used in the HDTV, acellular phone, and a blu-ray player at present. At present, MovingPicture Experts Group (MPEG) and Video Coding Experts Group (VCEG)commonly aims at standardizing High Efficiency Video Coding (HEVC) whichis a next-generation video codec and encoding a video including a UHDvideo with twice higher compression efficiency than the H.264/AVC. Thiscan provide a high-definition video at a lower frequency than at presenteven in 3D broadcasting and a mobile communication network as well asthe HD and UHD videos.

At present, the HEVC sets a codec called an HEVC test model (HM) througha contribution of each institution after a first Joint CollaborationTeam Video Coding (JCT-VC) meeting was opened in April, 2010.

DISCLOSURE Technical Problem

An object of the present invention is to provide a method fordetermining whether a neighboring block is usable and an apparatus usingthe same, in configuring a motion candidate list.

Further, another object of the present invention is to provide a methodfor providing parallelism between prediction units within a coding unitand an apparatus using the same, in configuring a motion candidate list.

Yet another object of the present invention is to improve video encodingand decoding efficiency.

Technical Solution

In accordance with an aspect of the present invention, there is provideda video decoding method, including the steps of: determiningavailability for a neighboring block of a current block; configuring amerge candidate list for the current block based on a result of theavailability determination; and performing motion compensation for thecurrent block based on the merge candidate list, and the step ofdetermining the availability includes the step of deriving blockavailability information for the neighboring block; and the step ofderiving availability for motion information of the neighboring block,and in the step of determining the availability for the neighboringblock, when the neighboring block is multiple, availability for theneighboring blocks is determined according to a predetermined orderrestriction.

When the position of the current block is (xP, yP), the neighboringblock may include a first block including a pixel that is present at(xP−1, yP+nPSH), a second block including a pixel that is present at(xP−1, yP+nPSH−1), a third block including a pixel that is present at(xP+nPSW, yP−1), a fourth block including a pixel that is present at(xP+nPSW−1, yP−1), and a fifth block including a pixel that is presentat (xP−1, yP−1).

in the step of determining the availability for the neighboring block,when the neighboring block is multiple, availability for the neighboringblocks may be determined according to a predetermined order restrictionand when the merge candidate lists of the current block and theneighboring block are disabled to be derived in parallel, the blockavailability information may be set as false (0).

Setting the block availability information as false may mean that thecorresponding block is not present or encoded in an intra-mode.

In the step of determining the availability for the neighboring block,the partition form of the current block is one of PART_N×2N, PART_nL×2N,and PART_nR×2N and the index for the current block in the coding unit,partIdx is ‘1’, the block availability information for the second blockmay be set as false (0).

In the step of determining the availability for the neighboring block,the partition form of the current block is one of PART_2N×N, PART_2N×n,and PART_2N×nD and the index for the current block in the coding unit,partIdx is ‘1’, the block availability information for the fourth blockmay be set as false (0).

In the step of deriving the availability for the motion information ofthe neighboring block, the availability for the motion information ofthe second block may be derived earlier than the availability for themotion information of the first, third block, fourth, and fifth blocks.

In the step of deriving the availability for the motion information ofthe neighboring block, the availability for the motion information ofthe fourth block may be derived earlier than the availability for themotion information of the third and fifth blocks.

In the step of deriving the availability for the motion information ofthe neighboring block, the availability for the motion information ofthe fifth block may be derived later than the availability for themotion information of the first, second, third, and fourth blocks.

The step of deriving the availability for the motion information of theneighboring block may be performed in the order of the second block, thefourth block, the third block, the first block, and the fifth block.

In the step of deriving the block availability information, when theneighboring block is not present or encoded in an intra-mode, the blockavailability information may be set as false (0), and when the blockavailability information is set as false (0), the availability for themotion information may be set to 0.

In the step of deriving the block availability information, when theblock availability information of the second block is true (1), and themotion information of the second block and the motion information of thefourth block are the same as each other, the availability for the motioninformation of the fourth block may be set to 0.

In the step of deriving the block availability information, when theblock availability information of the fourth block is true (1), and themotion information of the fourth block and the motion information of thethird block are the same as each other, the availability for the motioninformation of the third block may be set to 0.

In the step of deriving the block availability information, when theblock availability information of the second block is true (1), and themotion information of the second block and the motion information of thefirst block are the same as each other, the availability for the motioninformation of the first block may be set to 0.

In the step of deriving the block availability information, when theblock availability information of the second block is true (1), and themotion information of the second block and the motion information of thefifth block are the same as each other, the availability for the motioninformation of the fifth block may be set to 0.

In the step of deriving the block availability information, when theblock availability information of the fourth block is true (1), and themotion information of the fourth block and the motion information of thefifth block are the same as each other, the availability for the motioninformation of the fifth block may be set to 0.

In the step of deriving the availability for the motion information ofthe neighboring block, the availability for the motion information ofall of the first, second, third, and fourth blocks is 1, theavailability for the motion information of the fifth block may be set to0.

In accordance with another aspect of the present invention, a videodecoding apparatus includes: an entropy coding module encodinginformation on a merge candidate list used to perform an inter-screenprediction of a current block; and a prediction module determiningavailability for a neighboring block of the current block, configuring amerge candidate list for the current block based on a result of theavailability determination, and performing motion compensation for thecurrent block based on the merge candidate list, the prediction module,in order to determine the availability, derives block availabilityinformation for the neighboring block and derives availability formotion information of the neighboring block, and determines availabilityfor the neighboring blocks according to a predetermined orderrestriction when the neighboring block is multiple.

Advantageous Effects

According to embodiments of the present invention, provided are a methodfor determining whether a neighboring block is usable and an apparatususing the same, in configuring a motion candidate list.

Further, according to the present invention, provided are a method forproviding perfect parallelism between prediction units within a codingunit and an apparatus using the same.

Therefore, provided are a method and an apparatus for videoencoding/decoding that can improve video encoding and decodingefficiency.

DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating a configuration of a videoencoding apparatus according to an embodiment of the present invention;

FIG. 2 is a block diagram illustrating a configuration of a videodecoding apparatus according to an embodiment of the present invention;

FIG. 3 is a diagram illustrating one example of a neighboring blocks ofa current block used as a merge motion candidate list;

FIG. 4 is a control flowchart for describing a motion compensationprocess in inter-screen encoding;

FIG. 5 is a diagram illustrating one example of setting the merge motioncandidate list when one CU is divided into two PUs according to oneexample;

FIG. 6 is a diagram illustrating one example of setting the merge motioncandidate list when one CU is divided into two PUs according to anotherexample;

FIG. 7 is a diagram illustrating one example of neighboring blocks of acurrent block;

FIG. 8 is a diagram illustrating various examples for a method forrestricting an order of deciding motion information availability;

FIG. 9 is a diagram illustrating a neighboring block when availabilityinformation of block motion information is sequentially determined;

FIG. 10 illustrates an example in which one CU is partitioned into aplurality of Pus;

FIG. 11 is a control flowchart for describing a method for resettingblock availability information according to an embodiment of the presentinvention; and

FIG. 12 is a diagram illustrating the current block and the neighboringblock for describing creation of a merge candidate list of the currentblock.

MODE FOR INVENTION

Hereinafter, embodiments of the present invention will be described indetail with reference to the accompanying drawings. In describing theembodiments of the present specification, when it is determined that thedetailed description of the known art related to the present inventionmay obscure the gist of the present invention, the detailed descriptionthereof will be omitted.

It will be understood that when an element is simply referred to asbeing ‘connected to’ or ‘coupled to’ another element without being‘directly connected to’ or ‘directly coupled to’ another element in thepresent description, it may be ‘directly connected to’ or ‘directlycoupled to’ another element or be connected to or coupled to anotherelement, having the other element intervening therebetween. Moreover, acontent of describing “including” a specific component in the presentinvention does not exclude a component other than the correspondingcomponent and means that an additional component may be included in theembodiments of the present invention or the scope of the technicalspirit of the present invention.

Terminologies such as first or second may be used to describe variouscomponents but the components are not limited by the aboveterminologies. The above terminologies are used only to discriminate onecomponent from the other component. For example, without departing fromthe scope of the present invention, a first component may be referred toas a second component, and similarly, a second component may be referredto as a first component.

Further, components described in the embodiments of the presentinvention are independently illustrated in order to show differentcharacteristic functions and each component is not constituted byseparated hardware or one software constituting unit. That is, eachcomponent is arranged and included as the respective components and atleast two components among the respective components are added up toform one component or one component is divided into a plurality ofcomponents to perform functions and the integrated embodiment andseparated embodiments of each component are also included in the scopeof the present invention without departing from the spirit of thepresent invention.

Further, some components are not requisite components that performessential functions but selective components for just improvingperformance in the present invention. The present invention may beimplemented with the requisite component for implementing the spirit ofthe present invention other than the component used to just improve theperformance and a structure including only the requisite component otherthan the selective component used to just improve the performance isalso included in the scope of the present invention.

FIG. 1 is a block diagram illustrating a configuration of a videoencoding apparatus according to an embodiment of the present invention.

Referring to FIG. 1, the video encoding apparatus 100 includes a motionprediction module 111, a motion compensation module 112, an intraprediction module 120, a switch 115, a subtractor 125, a transformmodule 130, a quantization module 140, an entropy coding module 150, aninverse quantization module 160, an inverse transform module 170, anadder 175, a filter module 180, and a reference video buffer 190.

The video encoding apparatus 100 may code an input video in an intramode or an inter mode, and output a bitstream. The intra predictionmeans a prediction in a screen, and the inter prediction means aprediction between screens. In the intra mode, the switch 115 is shiftedto the intra, and in the inter mode, the switch 115 is shifted to theinter mode. The video encoding apparatus 100 generates a predictionblock for an input block of the input video, and then may code adifference between the input block and the prediction block.

In the intra mode, the intra prediction module 120 performs a spatialprediction by using a pixel value of a pre-coded block around a currentblock to generate the prediction block.

In the inter mode, the motion prediction module 111 may find a regionwhich is most matched with the input block in a reference video storedin the reference video buffer 190 during the motion prediction processto calculate a motion vector. The motion compensation module 112corrects the motion by using the motion vector and the reference videostored in the reference video buffer 190 to generate the predictionblock.

The subtractor 125 may generate a residual block by the differencebetween the input block and the generated prediction block. Thetransform module 130 performs transform for the residual block to outputa transform coefficient. In addition, the quantization module 140quantizes the input transform coefficient according to a quantizationparameter to output a quantized coefficient.

The entropy coding module 150 entropy-codes symbols according toprobability distribution based on values calculated from thequantization module 140 or coding parameter values calculated in thecoding process to output a bitstream. The entropy coding method is amethod in which symbols having various values are received and expressedby decodable binary strings while removing statistical redundancy.

Here, the symbol means a coding/decoding target syntax element, a codingparameter, a value of a residual signal, and the like. The codingparameter, as a parameter required for encoding and decoding, mayinclude not only information coded in the encoding apparatus to betransferred to the decoding apparatus like the syntax element, but alsoinformation which may be inferred from the encoding or decoding process,and means information required when the video is coded or decoded. Thecoding parameter may include values or statistics of for example, anintra/inter prediction mode, a movement/motion vector, a reference videoindex, an encoding block pattern, presence of a residual signal, atransform coefficient, a quantized transform coefficient, a quantizationparameter, a block size, block segment information, and the like.Further, the residual signal may mean a difference between an originalsignal and a prediction signal, and may also mean a signal having atransformed form of the difference between the original signal and theprediction signal or a signal having a transformed and quantized form ofthe difference between an original signal and a prediction signal. Theresidual signal may be referred to as a residual block in a block unit.

In the case where the entropy coding is applied, a few of bits areallocated to a symbol having high occurrence probability and a lot ofbits are allocated to a symbol having low occurrence probability toexpress the symbols, and as a result, a size of a bitstream for codingtarget symbols may be reduced. Accordingly, compression performance ofvideo coding may be enhanced through the entropy coding.

For the entropy coding, coding methods such as exponential golomb,context-adaptive variable length coding (CAVLC), and context-adaptivebinary arithmetic coding (CABAC) may be used. For example, a table forperforming the entropy coding such as a variable length coding/code(VLC) table may be stored in the entropy coding module 150, and theentropy coding module 150 may perform the entropy coding by using thestored VLC table. Further, the entropy coding module 150 derives abinarization method of a target symbol and a probability model of atarget symbol/bin, and then may also perform the entropy coding by usingthe derived binarization method or probability model.

The quantized coefficient may be inversely quantized in the inversequantization module 160 and inversely transformed in the inversetransform module 170. The inversely quantized and inversely transformedcoefficient is added to the prediction block by the adder 175 togenerate a restore block.

The restore block passes though the filter module 180, and the filtermodule 180 may apply at least one of a deblocking filter, a sampleadaptive offset (SAO), and an adaptive loop filter (ALF) to the restoreblock or a restore picture. The restore block passing through the filtermodule 180 may be stored in the reference image buffer 190.

FIG. 2 is a block diagram illustrating a configuration of a videodecoding apparatus according to an embodiment of the present invention.Referring to FIG. 2, the video decoding apparatus 200 includes anentropy coding module 210, an inverse quantization module 220, aninverse transform module 230, an intra prediction module 240, a motioncompensation module 250, a filter module 260, and a reference videobuffer 270.

The video decoding apparatus 200 receives a bitstream output from theencoding apparatus to perform decoding in an inter mode or an inter modeand output a reconfigured video, that is, a restore video. In the intramode, the switch may be shifted to the intra, and in the inter mode, theswitch may be shifted to the inter mode. The video decoding apparatus200 obtains a residual block restored from the input bitstream andgenerates a prediction block, and then may generate the reconfiguredblock, that is, the restore block by adding the restored residual blockand the prediction block.

The entropy decoding module 210 entropy-decodes the input bitstreamaccording to probability distribution to generate symbols including asymbol having a quantized coefficient form. The entropy decoding methodis a method of receiving binary strings to generate respective symbols.The entropy decoding method is similar to the aforementioned entropycoding method.

The quantized coefficient is inversely quantized in the inversequantization module 220 and inversely transformed in the inversetransform module 230, and as a result, a restored residual block may begenerated.

In the intra mode, the intra prediction module 240 performs a spatialprediction by using a pixel value of a pre-encoded block around acurrent block to generate the prediction block. In the inter mode, themotion compensation module 250 corrects the motion by using the motionvector and the reference video stored in the reference video buffer 270to generate the prediction block.

The restored residual block and the prediction block are added by theadder 255, and the added blocks pass through the filter module 260. Thefilter module 260 may apply at least one of a deblocking filter, an SAO,and an ALF to the restore block or the restore picture. The filtermodule 260 outputs the reconfigured video, that is, the restore video.The restore video may be stored in the reference video buffer 270 andused for prediction between screens.

Among the entropy coding module 210, the inverse quantization module220, the inverse transform module 230, the intra prediction module 240,the motion compensation module 250, the filter module 260, and thereference video buffer 270 included in the video decoding apparatus 200,constituent elements directly related to the video decoding, forexample, the entropy coding module 210, the inverse quantization module220, the inverse transform module 230, the intra prediction module 240,the motion compensation module 250, the filter module 260, and the likeare separated from other constituent elements to be expressed as adecoding module.

Further, the video decoding apparatus 200 may further include a parsingmodule (not illustrated) parsing information regarding the encoded videoincluded in the bitstream. The parsing module may include the entropydecoding module 210, and may also be included in the entropy decodingmodule 210. The parsing module may be further implemented as oneconstituent element of the decoding module.

Generally, in the prediction between the screens, at least one of aprevious picture or a next picture of the current picture is referred toas a reference picture, and prediction for the current block may bepreformed based on the reference picture. A video used for theprediction of the current block is referred to as a reference picture ora reference frame.

A region in the reference picture may be represented by using areference picture index refIdx indicating the reference picture, themotion picture, and the like.

In the prediction between the screens, the reference block correspondingto the reference picture and the current block in the reference pictureis selected to generate the prediction block for the current block.

In the prediction between the screens, the encoding apparatus and thedecoding apparatus derive motion information of the current block andthen perform the prediction between the screens and/or the motioncompensation based on the derived motion information. In this case, theencoding apparatus and the decoding apparatus use motion information ofa restored neighboring block and/or a collocated block corresponding tothe current block in a pre-restored collocated picture, therebyimproving coding/decoding efficiency.

Here, the restored neighboring block, as a block in the restored currentpicture which is pre-coded and/or decoded, may include a block adjacentto the current block and/or a block positioned at an outer corner of thecurrent block. Further, the encoding apparatus and the decodingapparatus may determine a relatively predetermined position based on ablock that is present at a position spatially corresponding to thecurrent block in the collocated picture, and derive the collocated blockbased on the determined relative position (internal and/or externalposition of the block that is present at the position spatiallycorresponding to the current block). Here, as an example, the collocatedpicture may correspond to one picture among reference pictures includedin a reference picture list.

In the prediction between screens, the prediction block may be generatedso that a residual signal with the current block is minimized and thesize of the motion vector is minimized.

Meanwhile, a method of deriving the motion information may varyaccording to a prediction mode of the current block. The prediction modeapplied for the inter prediction may include an advanced motion vectorpredictor (AMVP), a merge, and the like.

For example, in the case of applying the advanced motion vectorpredictor (AMVP), the encoding apparatus and the decoding apparatus maygenerate a prediction motion vector candidate list, by using the motionvector of the restored neighboring block and/or the motion vector of thecollocated block. That is, the motion vector of the restored neighboringblock and/or the motion vector of the collocated block may be used as aprediction motion vector candidate. The encoding apparatus may transmita prediction motion vector index indicating an optimal prediction motionvector selected among the prediction motion vector candidates includedin the list, to the decoding apparatus. In this case, the decodingapparatus may select the prediction motion vector of the current blockamong the prediction motion vector candidates included in the predictionmotion vector candidate list, by using the prediction motion vectorindex.

The encoding apparatus may calculate a motion vector difference (MVD)between the motion vector of the current block and the prediction motionvector, and may code the motion vector difference (MVD) to transmit thecoded motion vector difference (MVD) to the decoding apparatus. In thiscase, the decoding apparatus may decode the received motion vectordifference, and may derive the motion vector of the current blockthrough a sum of the decoded motion vector difference and the predictionmotion vector.

The encoding apparatus may further transmit the reference picture indexindicating the reference picture and the like to the decoding apparatus.

The decoding apparatus predicts the motion vector of the current blockby using the motion information of the neighboring block, and may derivethe motion vector of the current block by using the residual receivedfrom the encoding apparatus. The decoding apparatus may generate theprediction block for the current block based on the derived motionvector and the reference picture index information received from theencoding apparatus.

In the case of a skip mode which is one of other modes used in theprediction between the screens, information of the neighboring block maybe used in the current block as it is. Accordingly, in the case of theskip mode, the encoding apparatus does not transmit syntax informationsuch as residual other than information indicating whether motioninformation of any block is used as the motion information of thecurrent block.

As another example, in the case where merge motion, that is, the mergeis applied, the encoding apparatus and the decoding apparatus maygenerate a merge motion candidate list (merge candidate list) by usingthe motion information of the restored neighboring block and/or themotion information of the collocated block. In this case, the motioninformation includes at least one of the motion vector, the index forthe reference video, and a prediction direction (uni-direction,bi-direction, and the like).

The merge motion may be a merge motion of a coding unit (hereinafter,referred to as a “CU”) and a merge motion of a prediction unit(hereinafter, referred to as a “PU”). In the case of performing themerge motion by the CU or the PU (hereinafter, for convenience, referredto as a ‘block’) unit, there is a need to transmit information regardingwhether the merge motion is performed for each block partition, andinformation regarding whether the merge motion is performed with anyblock among the neighboring blocks adjacent to the current block (a leftadjacent block of the current block, an upper adjacent block of thecurrent block, a temporally adjacent block of the current block, and thelike).

The merge motion candidate list represents a list in which the motioninformation is stored, and is generated before the merge motion isperformed. Here, the motion information stored in the merge motioncandidate list may be motion information of the neighboring blockadjacent to the current block or motion information of a blockcollocated to the current block in the reference video. Further, themotion information stored in the merge motion candidate list may be newmotion information made by combining the motion information which ispresent in the merge motion candidate list in advance.

FIG. 3 is a diagram illustrating one example of neighboring blocks of acurrent block used as a merge motion candidate list.

The merge motion candidate list determines whether motion information ofthe corresponding block may be used for the merge motion of the currentblock with respect to neighboring blocks A, B, C, D, and E of FIG. 3 anda candidate block H or M at the same position, and in the case of usingthe motion information, the motion information of the correspondingblock may be input in the merge motion candidate list.

The same position candidate block used as a temporal candidateprediction block may be a prediction block H including a pixel having aposition (xP+nPSW, yP+nPSH) in the collocated picture of the currentblock based on a pixel position (xP, yP) in the picture including thecurrent block or a prediction block M including a pixel having aposition (xP+(nPSW>>1), yP+(nPSH>>1)), in the case where a predictionblock including a pixel having a position (xP+nPSW, yP+nPSH) isunusable.

In the case where each neighboring block verifies whether or not to havethe same motion information and has the same motion information, themotion information of the corresponding neighboring block is notincluded in the merge motion candidate list.

As an embodiment, in FIG. 3, when a merge motion candidate list for ablock X is generated, the neighboring block A is usable and included inthe merge motion candidate list, and the neighboring block B may beincluded in the merge motion candidate list only when the neighboringblock B does not have the same motion information as the neighboringblock A. In the same manner, the neighboring block C may be included inthe merge motion candidate list only when the neighboring block C doesnot have the same motion information as the neighboring block B. In thesame manner, this may be applied to the neighboring block D and theneighboring block E.

Here, the same motion information may mean using the same motion vectorand the same reference picture, and using the same prediction direction(uni-direction (forward direction and backward direction), andbi-direction).

Finally, in FIG. 3, the merge motion candidate list for the block X maybe added in a predetermined order, for example, a block order ofA→B→C→D→E→H (or M).

FIG. 4 is a control flowchart for describing a motion compensationprocess in inter-screen coding.

As illustrated in FIG. 4, in the motion compensation process, wheninformation on the current block and the neighboring block is input,availability for the neighboring blocks is determined (S410), a motioncandidate list is configured (S420), motion information for the currentblock is output through the configured motion candidate list, andfinally, a video in which the motion is corrected is output (S430).

In FIG. 4, the neighboring blocks used for configuring the motioncandidate list for the current block may be variously set in plural, andfor example, may be the neighboring blocks A, B, C, D, and E and thecandidate block H or M at the same position.

As a first step of FIG. 4, determining availability of the neighboringblock (S411) is a process of determining that the corresponding block isavailable when the corresponding neighboring block is present, and as aresult of determining the availability, block availability informationis output. Here, the presence of the neighboring block may mean that theneighboring block is present in the same video (picture), a slice, and atile to which the current block belongs to be accessible in the decodingprocess. In the present invention, the determining may be used as ameaning of decision or setting. In the determining of the availability,additionally, only in the case where the corresponding neighboring blockis not coded in the screen, it may be determined that the correspondingneighboring block is available.

As a determined result, when the block availability information is ‘1’,the corresponding block is usable (for example, is present in thevideo), and when the block availability information is ‘0’, thecorresponding block is unusable (for example, positioned outside thevideo and does not be present), or vice versa.

Next, availability for motion information of the neighboring block isdetermined based on the block availability information (S413). As aresult, availability information of the block motion informationrepresenting whether the motion information of the correspondingneighboring block is included in the motion candidate list of thecurrent block is output.

Here, when the availability information of the block motion informationis ‘1’, the corresponding block is usable, and when the availabilityinformation is ‘0’, the corresponding block is unusable, or vice versa.

According to the present invention, the determining of the availabilityof the motion information for the neighboring blocks may be performed ina random order, and a predetermined order restriction between theneighboring blocks needs to be followed.

When the determining of the determining of the availability of themotion information for the neighboring blocks of the motion informationfor the neighboring blocks is completed, an initial motion candidatelist is configured based on the availability information of the blockmotion information (S421), and the neighboring blocks of FIG. 3 may beadded to the motion candidate list in the order of A, B, C, D, E, H, andM.

Thereafter, the motion candidate list may be reconfigured, and a finalmotion candidate list may be configured through the reconfigurationprocess (S423).

The motion information of the current block among motion candidatesincluded in the final motion candidate list is selected (S431), and themotion compensation for the current block is performed by using theselected motion information (S423). The video in which the motion iscorrected is output through the process of FIG. 4.

The encoding apparatus may select a merge motion candidate which mayprovide optimal coding efficiency among the merge motion candidatesincluded in the merge motion candidate list as the motion informationfor the current block. In the merge motion candidate list, an index fora candidate in which the current block performs the merge motion isreferred to as a merge motion index merge_idx (hereinafter, referred toas the ‘merge_idx’), and the selected merge index is included in thebitstream to be transmitted to the decoding apparatus.

In the case where the same motion information is present in the mergemotion candidate list, only one of the same motion informations is leftin the merge motion candidate list. The number of motion information inthe merge motion candidate list may be set as a predetermined number.For example, the number of motion informations in the merge motioncandidate list may be set as maximum five (or a predetermined number).

The decoding apparatus may select one of merge candidates included inthe merge motion candidate list by using the transmitted merge index,and may determine the selected merge candidate as the motion informationof the current block. Accordingly, in the case where the merge motionmode is applied, the motion information of the restored neighboringblock and/or the collocated block may be used as the motion informationof the current block as it is. The decoding apparatus may restore thecurrent block by adding the prediction block and the residualtransmitted from the encoding apparatus.

When the merge motion index value is not indicated, the index value maybe inferred as ‘0’.

FIG. 5 is a diagram illustrating one example of setting the merge motioncandidate list, when one CU is divided into two PUs according to anembodiment. As illustrated in FIG. 5, the CU is partitioned into N×2N,and PartIdx of a first left prediction block PU 0 is identified as 0,and PartIdx of a second right prediction block PU1 is identified as 1.

The motion information of the neighboring block for the PU may be motioninformation of neighboring blocks A0, A1, B0, B1, and B2 adjacent to thecurrent block or motion information of a block (not illustrated)collocated to the current block in the reference video. FIG. 5Aillustrates neighboring blocks used for configuring the merge motioncandidate list for PU 0, and FIG. 5B illustrates neighboring blocks usedfor configuring the merge motion candidate list for PU 1.

When the merge motion candidate list for PU 1 is configured, the mergemotion candidate list may be configured in parallel with another PU soas not to refer to motion information of another PU in the same CU, andto this end, in FIG. 5B, a block A₁ at the PU 0 may not be included inthe merge motion candidate list of the PU 1. That is, in FIG. 5B, theblock A₁ at the PU 0 may not be used for the configuration of the mergemotion candidate list of the PU 1 and the motion information of theblock A₁ may not be accessed when the merge motion candidate list for PU1 is configured (or motion information may not be present, or there maybe no availability of the block motion information).

FIG. 6 is a diagram illustrating one example of setting the merge motioncandidate list, when one CU is divided into two PUs according to anotherembodiment. As illustrated in FIG. 6, the CU is partitioned as 2N×N, andin a first upper prediction block, PU 0, PartIdx is identified as 0, andin a lower right prediction block PU1, PartIdx is identified as 1.

The motion information of the neighboring block for the PU may be motioninformation of neighboring blocks A0, A1, B0, B1, and B2 adjacent to thecurrent block or motion information of a block (not illustrated)collocated to the current block in the reference video. FIG. 6Aillustrates neighboring blocks used for configuring the merge motioncandidate list for PU 0, and FIG. 6B illustrates neighboring blocks usedfor configuring the merge motion candidate list for PU 1.

When the merge motion candidate list for PU 1 is configured, the mergemotion candidate list may be configured in parallel with another PU soas not to refer to motion information of another PU in the same CU, andto this end, in FIG. 6B, a block B₁ at the PU 0 may not be included inthe merge motion candidate list of the PU 1. That is, in FIG. 6B, theblock B₁ at the PU 0 may not be used for the configuration of the mergemotion candidate list of the PU 1 and the motion information of theblock A₁ may not be accessed when the merge motion candidate list for PU1 is configured (or motion information may not be present, or there maybe no availability of the block motion information).

Meanwhile, the present invention relates to a method and an apparatus ofderiving motion candidate availability for neighboring blocks adjacentto a target block (called a current block) configured in the motioncandidate list when the motion candidate list for motion prediction isconfigured.

FIG. 7 is a diagram illustrating one example of neighboring blocks of acurrent block.

Referring to FIG. 7, the neighboring blocks adjacent to a current blockX may be divided into left blocks A0 and A1, upper blocks B0 and B1, andan edge block C. The present invention may configure a motion candidatelist of prediction units PUs which belong to the same coding unit CU inparallel by restricting an order of deciding motion informationavailability for whether the neighboring blocks are usable as the motioncandidate.

FIG. 8 is a diagram illustrating various examples for a method forrestricting an order of deciding motion information availability.

Referring to FIG. 8, a method for restricting an order of decidingmotion information availability may include (a) an upper prioritymethod, (b) a left priority method, and (c) an upper/left parallelmethod.

The upper priority method is a method of deciding motion informationavailability for one of the upper blocks earlier than other neighboringblocks, and the left priority method is a method of deciding motioninformation availability for one of the left blocks earlier than otherneighboring blocks.

In order to increase parallelism of a process of deciding the motioninformation availability, the upper/left parallel deciding method like(c) may be used, and in this case, decision of the motion informationavailability for the left blocks and decision of the motion informationavailability for the upper blocks may be performed in parallel.

A motion information similarity determining process of determiningsameness of the motion information may be included in the motioninformation availability determining process of each neighboring blockso that a neighboring block having duplicated motion information is notincluded in the motion candidate list.

For example, when the motion information availability for B0 of FIG. 7is determined, in the case where the motion information of B0 is thesame as the motion information of B1, it is determined that the motioninformation of B0 is not available.

According to the present invention, even in the case where the motioninformation sameness determining process is included in the motioninformation availability determining process, the order of determiningthe motion information availability needs to be restricted asillustrated in FIG. 8. For example, only in the case where B1 is priorto B0 in the order of determining the motion information availabilityfor the neighboring blocks, the motion information availability of B0may be determined according to whether the motion information of B0 isthe same as the motion information of B1.

On the other hand, that is, only in the case where B0 is prior to B1 inthe order of determining the motion information availability for theneighboring blocks, the motion information availability of B0 may not bedetermined according to whether the motion information of B0 is the sameas the motion information of B1.

In the present invention, (b) the left priority method among the threemethods of restricting the order of deciding the motion informationavailability will be described as an example. However, the describedcontents including the availability determining process of theneighboring block and contents to be described below may be applied to(a) the upper priority deciding method and (c) the upper/left paralleldeciding method, and this may be apparent to those skilled in the art.

According to the present invention, when the merge motion candidate listof the PU 1 of FIG. 5B is configured, the neighboring block B₁ mayforeknow that the neighboring block A₁ is unusable. Accordingly, whenthe merge motion candidate list of the PU 1 of FIG. 5B is configured,the availability information of the neighboring block A₁ is verified,and as a result, whether the neighboring block B₁ and the neighboringblock A₁ have the same motion information needs not to be verified.

In other words, in order to configure the merge motion candidate list ofthe PU 1 of FIG. 5B, since the merge motion candidate list needs not toaccess the motion information of the neighboring block A₁ which belongsin the same CU as the PU 1, the merge motion candidate lists of PU 0 andPU 1 may be configured in parallel.

Similarly, when the merge motion candidate list of the PU 1 of FIG. 6Bis configured, the neighboring block B₀ may foreknow that theneighboring block B₁ is unusable. Accordingly, when the merge motioncandidate list of the PU 1 of FIG. 6B is configured, the availabilityinformation of the neighboring block B₁ is verified, and as a result,whether the neighboring block B₁ and the neighboring block B₀ have thesame motion information needs not to be verified.

In other words, in order to configure the merge motion candidate list ofthe PU 1 of FIG. 6B, since the merge motion candidate list needs not toaccess the motion information of the neighboring block B₁ which belongsin the same CU as the PU 1, the merge motion candidate lists of PU 0 andPU 1 may be configured in parallel.

A detailed method for restraining the motion information availabilitydeciding order for neighboring blocks while configuring the merge motioncandidate list of the PU in parallel may include a method forsequentially determining the availability information of the blockmotion information and a method for resetting the block availabilityinformation after determining availability of the neighboring blocks.

[Method 1] One Example of Sequentially Determining AvailabilityInformation of Block Motion Information in Configuring Merge MotionCandidate List

FIG. 9 is a diagram illustrating a neighboring block when availabilityinformation of block motion information is sequentially determined andillustrates neighboring blocks A, B, C, D, and E of a current block X.

In the present invention, ‘sequentially’ may mean that information whichis in a current or subsequent order is dependent on information which isin a previous order.

Whether the corresponding block motion information may be used as themotion information for the neighboring block (the availabilityinformation of the block motion information) may be determined in apredetermined order. In the case of following a left priority decidingmethod of most preferentially deciding motion information availabilityfor one of left blocks to other neighboring blocks, it is determinedwhether motion information of a corresponding block may be used in amerge motion of a current block in the order of A, B, C, D, and E blocksand when the motion information of the corresponding block is usable,the motion information of the corresponding block may be input into themerge motion candidate list.

FIG. 10 illustrates an example in which one CU is partitioned into aplurality of PUs.

As illustrated in FIG. 10, the CU is not partitioned and may be a 2N×2NPU, and may be partitioned into 2N×N, N×2N, and N×N having the samesize. Further, the CU may be asymmetrically partitioned like 2N×nU,2N×nD, nL×2N, and nR×2N.

[Method 2] One Example of Resetting Block Availability Information inConfiguring Merge Motion Candidate List

FIG. 11 is a control flowchart for describing a method for resettingblock availability information according to an embodiment of the presentinvention. FIG. 11 illustrates one example of a structural diagram of amethod for resetting block availability information in the step ofdetermining the availability for the neighboring blocks of FIG. 4(S410).

Referring to FIG. 11, first, block availability of the neighboring blockindicating whether the neighboring blocks are present is determined(S1110). As a determination result, block availability information isoutput.

Thereafter, the block availability of the neighboring block is reset(S1120).

As one example, in regard to the PU 1 of FIG. 5(b), the A₁ blockpositioned at the PU 0 of FIG. 5(b) may not be included in the mergemotion candidate list of the PU 1 in order to configure the merge motioncandidate list with other PUs in parallel.

Therefore, block availability information of the A1 block positioned atthe PU 0 of FIG. 5(b) is set to ‘0’ to prevent the corresponding blockfrom being used.

Next, the availability for the motion information of the neighboringblock is determined based on the set block availability information(S1130). Through step S1130, the availability information of the blockmotion information indicating whether the motion information of theneighboring block may be included in the motion candidate list of thecurrent block is output.

An initial motion candidate list is configured based on the availabilityinformation of the bock motion information.

The method for resetting the block availability information of FIG. 11may be applied to a case in which one CU is partitioned into a pluralityof PUs (as one example, 2N×N, N×2N, N×N, 2N×nU, 2N×nD, nL×2N, and nR×2Nin FIG. 10), that is, PUs partitioned from one CU.

One example of a decoding process using the aforementioned method 1 willbe described below.

Hereinafter, terms used in the present invention will be defined below.

PredMode represents a coding mode of a current prediction unit (PU), andMODE_SKIP, MODE_INTRA, and MODE_INTER are present.

Merge_flag represents whether the current PU block is encoded in a mergemode. When the current PU block is encoded in the merge mode, Merge_flagis set to ‘1’ and Merge_flag may be set contrary to this.

merge_idx represents an index indicating the motion information for thecurrent PU block in the motion information candidate list.

log 2_parallel_merge_level_minus2 defines a level of a parallel mergeskip. According to the present invention, the merge skip may be analyzedas a term indicating a merge mode and a skip mode among modes applied toan inter-screen prediction and the parallel merge skip may mean that themerge motion candidate list may be configured in parallel between blockswithin a specific region when the merge mode and/or the skip mode are/isapplied.

For example, when a value of the log 2_parallel_merge_level_minus2 is‘0’, the parallel merge skip is not performed. When the value of the log2_parallel_merge_level_minus2 is ‘1’, the parallel merge skip isperformed with respect to all PUs in an 8×8 block. When the value of thelog 2_parallel_merge_level_minus2 is ‘2’, the parallel merge skip isperformed with respect to all PUs in a 16×16 block and when the value ofthe log 2_parallel_merge_level_minus2 is ‘3’, the parallel merge skip isperformed with respect to all PUs in a 32×32 block. When the value ofthe log 2_parallel_merge_level_minus2 is ‘4’, the parallel merge skip isperformed with respect to all Pus in a 64×64 block.

Z-Scan Availability Derivation Process

[1] An input in the Z-scan availability derivation process will bedescribed below.

(xCurr, yCurr): a left top position of a current block associated with aposition of a left top position of a current picture;

(xN, yN): a left top position of a neighboring block associated with theposition of the left top position of the current picture

An output in the Z-scan availability derivation process will bedescribed below.

availableN: Available information of the neighboring block at a position(xN, yN)

[2] minBlockAddrCurr is set as an address of a minimum luminance blockin a z-scan order for the current block. In this case, theminBlockAddrCurr is as follows.minBlockAddrCurr=MinTbAddrZS[xCurr>>Log 2MinTrafoSize][yCurr>>Log2MinTrafoSize]

(Herein, MinTbAddrZS means a z-scan order array in a minimum transformblock and log 2MinTrafoSize means the size of the minimum transformblock.

[3] minBlockAddrN is set as an address of the minimum luminance block ina z-scan order for a neighboring block having the position (xN, yN).

If even one of following conditions (1) to (4) is ‘true’, minBlockAddrNis set to ‘1’.

(1) xN is smaller than ‘0’.

(2) yN is smaller than ‘0’.

(3) xN is larger than pic_width_in_luma_sample (the width of a video).

(4) yN is larger than pic_height_in_luma_sample (the width of thevideo).

Otherwise (that is, if the position (xN, yN) is in a picture boundary,the following is applied.minBlockAddrN=MinTbAddrZS[xN>>Log 2MinTrafoSize][yN>>Log 2MinTrafoSize][4] The neighboring block availability information availableN is derivedthrough the following process.

If even one of the following conditions (1) to (4) is ‘true’, availableNis set as ‘false’.

(1) minBlockAddrN is smaller than ‘0’.

(2) minBlockAddr is larger than minBlockAddrCurr.

(3) An address index of a slice including the neighboring block havingminBlockAddrN is different from an address index of a slice includingthe current block having minBlockAddrCurr.

(4) The neighboring block having minBlockAddrN is positioned a tiledifferent from the current block having minBlockAddrCurr. (herein, thetile is the same concept as dividing the video into slices and codinginformation of the block is not derived between the tiles.

Otherwise, availableN is set as ‘true’.

Availability Derivation Process of Prediction Block

[1] An input in the availability derivation process of the predictionblock will be described below.

(xC, yC): a left top position of a current luminance coding blockassociated with the left top position of the current picture;

(nCS): variable indicating the size of the current CU;

(xP, yP): the left top position of the current luminance coding blockassociated with the left top position of the current picture;

(nPbW, nPbH): a variable indicating the width and the height of thecurrent PU within the current CU block;

(partIdx): index of the current PU within the current CU block;

(xN, yN): the position of the neighboring block associated with the lefttop position of the current picture;

An output in the availability derivation process of the prediction blockwill be described below.

availableN: Available information of the neighboring block at theposition (xN, yN)

[2] A variable sameCb is defined to represent whether the currentluminance prediction block and a neighboring luminance prediction blockare the same luminance coding block.

If the following conditions (1) to (4) are all ‘true’, sameCb is set as‘true’.

(1) xC is equal to or smaller than xN.

(2) yC is equal to or smaller than yN.

(3) (xC+nCbS) is larger than xN.

(4) (yC+nCbS) is larger than yN.

Otherwise, sameCb is set as ‘false’.

Herein, if sameCb is ‘true’, it may be meant whether the currentluminance prediction block and the neighboring luminance predictionblock are included in the same luminance coding block or vice versa.

[3] The availability information of the neighboring prediction block,availableN is derived as follows.

If sameCb is ‘false’, availableN is set by applying the z-scanavailability derivation process.

Or, if the following conditions (1) to (5) are all ‘true’, availableN isset as ‘false’.

(1) (nPbW<<1) is equal to nCbS.

(2) (nPbH<<1) is equal to nCbS.

(3) partIdx is ‘1’.

(4) (yC+nPbH) is equal to or less than yN.

(5) (xC+nPbW) is larger than xN.

Otherwise, availableN is set as ‘true’.

When availableN is ‘true’ and PredMode[xN][yN] is MODE_INTRA, availableNis set as ‘false’.

Process of Deriving Motion Vector and Reference Picture Index

[1] An input in the process of deriving the motion vector and thereference picture index will be described below.

(xC yC): the left top position of the current coding unit (CU) block;

(xB, yB): the left top position of the current PU;

(nCS): a variable indicating the size of the current CU;

(nPSW, nPSH): a variable indicating the width and the height of thecurrent PU;

(partIdx): an index of the current PU within the current CU block;

An output in the process of deriving the motion vector and the referencepicture index will be described below.

(mvL0

mvL1): a motion vector for a luminance sample;

(mvCL0

mvCL1): a motion vector for a chrominance sample;

Reference picture indexes; refIdxL0 and refIdxL1

predFlagL0

predFlagL1: a variable indicating whether a prediction list is usable(an L0 or L1 prediction is performed)

[2] The position of the current PU block is set as xP=xC+xB, yP=yC+yB.

[3] mvL0, mvL1, refIdxL0, refIdxL1, PredFlagL0 and PredFlagL1 arederived through the following process.

If PredMode is MODE_SKIP, a process of deriving a luminance motionvector for the merge mode is performed. Herein, inputs are (xC, yC),(xP, yP), nCS, nPSW, nPSH, and partIdx and outputs are mvL0, mvL1,refIdxL0, refIdxL1, PredFlagL0, and PredFlagL1.

Or, if PredMode is MODE_INTER and merge_flag for the current PU block is‘1’, the process of deriving the luminance motion vector for the mergemode is performed. Herein, the inputs are (xC, yC), (xP, yP), nCS, nPSW,nPSH, and partIdx and the outputs are mvL0, mvL1, refIdxL0, refIdxL1,PredFlagL0, and PredFlagL1.

Otherwise, mvLX, refIdxLX, and PredFlagLX are set by syntax elementsref_idx_lx and mvd_lX. Herein, X may be replaced with ‘0’ or ‘1’.

Process of Deriving Luminance Motion Vector for Merge Mode

[1] An input in the process of deriving the luminance motion vector forthe merge mode will be described below.

(xC yC): the left top position of the current coding unit (CU) block;

(xP, yP): the left top position of the current PU;

(nCS): a variable indicating the size of the current CU;

(nPSW, nPSH): a variable indicating the width and the height of thecurrent PU;

(partIdx): an index of the current PU within the current CU block;

An output in the process of deriving the luminance motion vector for themerge mode will be described below.

(mvL0

mvL1): a motion vector for a luminance sample;

refIdxL0 and refIdxL1: reference picture indexes;

predFlagL0

predFlagL1: a variable indicating whether the prediction list is usable(the L0 or L1 prediction is performed)

[2] A variable singleMCLFlag (a common merge candidate list flag) isderived as follows.

If the value of log 2_parallel_merge_level_minus2 is larger than ‘0’ anda value of nCS is ‘8’, singleMCLFlag is set to ‘1’.

Otherwise, singleMCLFlag is set to ‘0’.

[3] The left top position (xP, yP) of the current PU and the variablesnPSW and nPSH indicating the width and the height of the current PU arederived as follows.

If singleMCLFlag is ‘1’, xC is input into xP, yC is input into yP, andnCS is input into nPSW and nPSH.

Additional explanation: When the value of singleMCLFlag is set to ‘1’,all PU blocks in one CU shares the merge candidate list for the 2N×2N PUregardless of a partition form.

[4] A step of configuring the merge candidate list to be used in a mergecoding mode and setting the motion information mvL0, mvL1, refIdxL0,refIdxL1, PredFlagL0, and PredFlagL1 for the current PU is performed inan order described below.

[4-1] A process of setting a merge motion candidate from a neighboringPU of the current CU including the current PU is performed.

Herein, the inputs are (xP, yP), nPSH, nPSW, singleMCLFlag and theoutputs are availableFlagN (a variable indicating whether theneighboring PU is usable), mvL0N, mvL1N, refIdxL0N, refIdxL1N,PredFlagL0N, and PredFlagL1N. (Herein, N may be replaced with A1, B1,B0, A0, and B2 of FIG. 12 and X may be replaced with ‘0’ or ‘1’.)

[4-2] A reference picture index for a temporal merge motion candidate,refIdxLX is set to ‘0’. Herein, X may be replaced with ‘0’ or ‘1’.

[4-3] A process of setting temporally inferred motion information as themerge motion candidate is performed. Herein, the inputs are (xP, yP),nPSH, nPSW, refIdxLX and the outputs are availableFlagLXCol (a variableindicating whether the temporally inferred motion information is usable)and mvLXCol (the temporally inferred motion information).

availableFlagCol (the variable indicating whether the temporallyinferred motion information is usable) and PredFlagLXCol (a variableindicating whether a prediction list for the temporally inferred motioninformation is usable (whether the L0 or L1 prediction is performed) areset as follows.

availableFlagCol=availableFlagLOCol∥availableFlagL1Col

PredFlagLXCol=availableFlagLXCol

[4-4] Next, the merge candidate list is configured as follows.

FIG. 12 is a diagram illustrating the current block and the neighboringblock for describing creation of the merge candidate list of the currentblock.

The position of a pixel that is present at a left top of the currentblock, that is, a prediction target block is defined as (xP, yP), thewidth of the prediction target block is defines as nPSW, and the heightof the prediction target block is defined as a variable nPSH.

Hereinafter, in the embodiment of the present invention, a spatialneighboring prediction block may include a left A1 block which is ablock including a pixel that is present in (xP−1, yP+nPSH−1), an A0block which is a block including a pixel which is present in (xP−1,yP+nPSH), a B0 block which is a block including a pixel positioned in(xP+nPSW, yP−1), a B1 block which is a block including a pixelpositioned in (xP+nPSW-MinPuSize, yP−1), and a B2 block which is a blockincluding a pixel positioned in (xP-MinPuSize, yP−1).

When the motion information of the corresponding block is usable in theorder of A1, B1, B0, A0, B2, and Col of FIG. 12, the motion informationof the corresponding block is sequentially input into the mergecandidate list. Herein, Col represents temporally inferred motioninformation.

[4-5] When the same motion information is present within the mergecandidate list, a step of leaving only one corresponding motioninformation is performed.

[4-6] A step of setting the number of motion information of the mergecandidate list and the maximum number of the merge candidate lists to‘5’ is performed.

[4-7] A step of adding a combination amount prediction merge candidateis performed when the corresponding picture is a B picture.

[4-8] A step of adding zero (0,0) motion information as a mergecandidate is performed.

[4-9] A step of setting motion information which is present in merge_idxin the merge candidate list as the motion information of the current PUis performed.

Step of Setting Merge Motion Candidate from Neighboring PU (Spatial PU)of Current PU

[1] An input in a step of setting the merge motion candidate from theneighboring PU (spatial PU) of the current PU will be described below.

(xC yC): the left top position of the current coding unit (CU) block;

(xP, yP): the left top position of the current PU;

(nCS): a variable indicating the size of the current CU;

(nPSW, nPSH): a variable indicating the width and the height of thecurrent PU;

singleMCLFlag: a variable indicating whether a common merge candidatelist for the current CU is usable;

(partIdx): an index of the current PU within the current CU block;

An output in the step of setting the merge motion candidate from theneighboring PU (spatial PU) of the current PU will be described below.(Herein, N may be replaced with A1, B1, B0, A0, and B2 of FIG. 12 and Xmay be replaced with ‘0’ or ‘1’.)

availableFlagN: a variable indicating whether motion information of aneighboring PU N is available;

refIdxLXN: a reference index of the neighboring PU N;

predFlagLXN: a variable indicating whether a prediction list for theneighboring PU N is usable;

mvLXN: a motion vector for the neighboring PU N

[2] A derivation order (restriction) according to a left prioritydeciding method below is applied in order to derive availableFlagN ofthe neighboring PU A0, A1, B0, B1, or B2 through the process of [3]below.

A1 needs to derive availableFlagN (herein, N=A1) earlier than A0, B0,B1, and B2.

B1 needs to derive availableFlagN (herein, N=B1) earlier than B0 and B2.

B2 needs to derive availableFlagN (herein, N=B2) later than A0, A1, B0,and B1.

An example of an order of deriving motion information availability of aneighboring block which coincides with the order restriction of the leftpriority deciding method will be described below.

A1→B1→A0→B0→B2,

A1→B1→B0→A0→B2

A1→B1→A0 and B0 (parallel derivation possible)→B2

A1→A0→B1→B0→B2

A1→A0 and B1 (parallel derivation possible)→B0→B2

[3] A process for determining whether the neighboring PU (spatial PU) ofthe current PU is usable as the merge motion candidate adopts a contentbelow. (Herein, the neighboring PU represents A1, B1, B0, A0, and B2 ofFIG. 12, N may be replaced with A1, B1, B0, A0, and B2 of FIG. 12, and(xN, yN) may be replaced with (xC−1, yC+nCS), (xC−1, yC+nCS−1), (xC+nCS,yC−1), (xC+nCS−1, yC−1), and (xC−1, yC−1).

[3-1] A process of determining whether the neighboring PU is availableis performed, and the inputs are (xC, yC), (xP, yP), nPbW, nPbH, (xN,yN), and partIdx and the output is the availability information of thePU positioned in (xN, yN), availableN.

[3-3] If even one of the following conditions (1) to (10) is ‘true’,availableFlagN is set to ‘0’ and mvLXN is set to ‘0,0’.

(1) (xP>>(log 2_parallel_merge_level_minus2+2)) is the same as (xN>>(log2_parallel_merge_level_minus2+2)) and (yP>>(log2_parallel_merge_level_minus2+2)) is the same as (yN>>(log2_parallel_merge_level_minus2+2)).

(2) N is B2 andavailableFlagA0+availableFlagA1+availableFlagB0+availableFlagB1 is ‘4’.

(3) The PU which is at the position [xN, yN] is disabled or encoded inan in-screen mode. That is, availableN is ‘0’.

(4) singleMCLFlag is ‘0’, the partition form of the current PU isPART_2N×N, PART_2N×nU, or PART_2N×nD, PartIdx is ‘1’, and N is ‘B1’.

(5) singleMCLFlag is ‘0’, the partition form of the current PU isPART_N×2N, PART_nL×2N, or PART_nR×2N, PartIdx is ‘1’, and N is ‘A1’.

(6) As a process of determining the similarity of the motioninformation, N is B1, and the motion information of the PU positioned in(xA1, yA1) and the motion information positioned in (xN, yN) are thesame as each other.

(7) As the process of determining the similarity of the motioninformation, N is B0, and the motion information of the PU positioned in(xB1, yB1) and the motion information positioned in (xN, yN) are thesame as each other.

(8) As the process of determining the similarity of the motioninformation, N is A0, and the motion information of the PU positioned in(xA1, yA1) and the motion information positioned in (xN, yN) are thesame as each other.

(9) As a process of determining the similarity of the motioninformation, N is B2, and the motion information of the PU positioned in(xA1, yA1) and the motion information positioned in (xN, yN) are thesame as each other.

(10) As the process of determining the similarity of the motioninformation, N is B2, and the motion information of the PU positioned in(xB1, yB1) and the motion information positioned in (xN, yN) are thesame as each other.

Otherwise, availableFlagN is set to ‘1’, and mvLXN, refIdxLXN, andpredFlagLXN are set to mvLX[xN, yN], refIdxLX[xN, yN], andpredFlagLX[xN, yN], respectively.

The Step of Setting the Merge Motion Candidate from the Neighboring PU(Spatial PU) of the Current PU

of the method 1 may be modified as below according to one example of thepresent invention.

[1] An input in the step of setting the merge motion candidate from theneighboring PU (spatial PU) of the current PU will be described below.

(xC yC): the left top position of the current coding unit (CU) block;

(xP, yP): the left top position of the current PU;

(nCS): a variable indicating the size of the current CU;

(nPSW, nPSH): a variable indicating the width and the height of thecurrent PU;

singleMCLFlag: a variable indicating whether a common merge candidatelist for the current CU is usable;

(partIdx): an index of the current PU within the current CU block

An output in this step will be described below. (Herein, N may bereplaced with A1, B1, B0, A0, and B2 of FIG. 12 and X may be replacedwith ‘0’ or ‘1’.)

availableFlagN: a variable indicating whether motion information of aneighboring PU N is available;

refIdxLXN: a reference index of the neighboring PU N;

predFlagLXN: a variable indicating whether a prediction list for theneighboring PU N is usable;

mvLXN: a motion vector for the neighboring PU N;

A derivation order (restriction) below is applied in order to deriveavailableFlagN of the neighboring PU A0, A1, B0, B1, or B2 through theprocess of [3] below.

B2 needs to derive availableFlagN (herein, N=B2) later than A0, A1, B0,and B1.

[3] A process for determining whether the neighboring PU (spatial PU) ofthe current PU is usable as the merge motion candidate will be describedbelow. (Herein, the neighboring PU represents A1, B1, B0, A0, and B2 ofFIG. 12, N may be replaced with A1, B1, B0, A0, and B2 of FIG. 12, and(xN, yN) may be replaced with (xC−1, yC+nCS), (xC−1, yC+nCS−1), (xC+nCS,yC−1), (xC+nCS−1, yC−1), and (xC−1, yC−1).

[3-1] It is determined whether the neighboring PU is available, and theinputs are (xC, yC), (xP, yP), nPbW, nPbH, (xN, yN), and partIdx and theoutput is the availability information of the PU positioned in (xN, yN),availableN.

[3-2] If even one of the following conditions (1) to (3) is ‘true’,availableN is set to ‘0’.

(1) (xP>>(log 2_parallel_merge_level_minus2+2)) is the same as (xN>>(log2_parallel_merge_level_minus2+2)) and (yP>>(log2_parallel_merge_level_minus2+2)) is the same as (yN>>(log2_parallel_merge_level_minus2+2)).

(2) singleMCLFlag is ‘0’, the partition form of the current PU isPART_2N×N, PART_2N×nU, or PART_2N×nD, PartIdx is ‘1’, and N is ‘B1’.

(3) singleMCLFlag is ‘0’, the partition form of the current PU isPART_N×2N, PART_nL×2N, or PART_nR×2N, PartIdx is ‘1’, and N is ‘A1’.

[3-2] If even one of the following conditions is ‘true’, availableFlagNis set to ‘0’ and mvLXN is set to ‘0.0’.

(1) N is B1, andavailableFlagA0+availableFlagA1+availableFlagB0+availableFlagB1 is ‘4’.

(2) The PU positioned at [xN, yN] is disabled or encoded intra. That is,availableN is ‘0’.

(3) As a process of determining the similarity of the motioninformation, N is B1, and the motion information of the PU positioned in(xA1, yA1) and the motion information positioned in (xN, yN) are thesame as each other.

(4) As the process of determining the similarity of the motioninformation, N is B0, and the motion information of the PU positioned in(xB1, yB1) and the motion information positioned in (xN, yN) are thesame as each other.

(5) As the process of determining the similarity of the motioninformation, N is A0, and the motion information of the PU positioned in(xA1, yA1) and the motion information positioned in (xN, yN) are thesame as each other.

(6) As a process of determining the similarity of the motioninformation, N is B2, and the motion information of the PU positioned in(xA1, yA1) and the motion information positioned in (xN, yN) are thesame as each other.

(7) As the process of determining the similarity of the motioninformation, N is the same as B2, and the motion information of the PUpositioned in (xB1, yB1) and the motion information positioned in (xN,yN) are the same as each other.

[3-3] Otherwise, availableFlagN is set to ‘1’, and mvLX[xN, yN],refIdxLX[xN, yN], and predFlagLX[xN, yN] are set to mvLXN, refIdxLXN,and predFlagLXN, respectively.

The step of setting the merge motion candidate from the neighboring PU(spatial PU) of the current PU of the method 1 may be modified as belowaccording to another example of the present invention.

[1] An input in the step of setting the merge motion candidate from theneighboring PU (spatial PU) of the current PU will be described below.

(xC yC): the left top position of the current coding unit (CU) block;

(xP, yP): the left top position of the current PU;

(nCS): a variable indicating the size of the current CU;

(nPSW, nPSH): a variable indicating the width and the height of thecurrent PU;

singleMCLFlag: a variable indicating whether a common merge candidatelist for the current CU is usable;

(partIdx): an index of the current PU within the current CU block;

An output in this step will be described below. Herein, N may bereplaced with A1, B1, B0, A0, and B2 of FIG. 12 and X may be replacedwith ‘0’ or ‘1’.

availableFlagN: a variable indicating whether motion information of aneighboring PU N is available;

refIdxLXN: a reference index of the neighboring PU N;

predFlagLXN: a variable indicating whether a prediction list for theneighboring PU N is usable;

mvLXN: a motion vector for the neighboring PU N

[2] The process for determining whether the neighboring PU (spatial PU)of the current PU is usable as the merge motion candidate adopts acontent below. Herein, the neighboring PU represents A1, B1, B0, and A0of FIG. 12, N may be replaced with A1, B1, B0, and A0 of FIG. 12, and(xN, yN) may be replaced with (xC−1, yC+nCS), (xC−1, yC+nCS−1), (xC+nCS,yC−1), and (xC+nCS−1, yC−1).

[2-1] The process of determining whether the neighboring PU is availableis performed, and herein, the inputs are (xC, yC), (xP, yP), nPbW, nPbH,(xN, yN), and partIdx and the output is the availability information ofthe PU positioned in (xN, yN), availableN.

[2-2] If even one of the following conditions (1) to (10) is ‘true’,availableFlagN is set to ‘0’.

(1) (xP>>(log 2_parallel_merge_level_minus2+2)) is the same as (xN>>(log2_parallel_merge_level_minus2+2)) and (yP>>(log2_parallel_merge_level_minus2+2)) is the same as (yN>>(log2_parallel_merge_level_minus2+2)).

(2) singleMCLFlag is ‘0’, the partition form of the current PU isPART_2N×N, PART_2N×nU, or PART_2N×nD, PartIdx is ‘1’, and N is ‘B1’.

(3) singleMCLFlag is ‘0’, the partition form of the current PU isPART_N×2N, PART_nL×2N, or PART_nR×2N, PartIdx is ‘1’, and N is ‘A1’.

[4-2] If even one of the following conditions is ‘true’, availableFlagNis set to ‘0’ and mvLXN is set to ‘0.0’.

(5) The PU positioned at [xN, yN] is disabled or encoded intra. (Thatis, availableN is ‘0’.)

(6) As the process of determining the similarity of the motioninformation, N is B1, availableA1=1, and the motion information of thePU positioned in (xA1, yA1) and the motion information positioned in(xN, yN) are the same as each other.

(7) As the process of determining the similarity of the motioninformation, N is B0, availableB1=1, and the motion information of thePU positioned in (xB1, yB1) and the motion information positioned in(xN, yN) are the same as each other.

(8) As the process of determining the similarity of the motioninformation, N is A0, availableA1=1, and the motion information of thePU positioned in (xA1, yA1) and the motion information positioned in(xN, yN) are the same as each other.

(9) As the process of determining the similarity of the motioninformation, N is B2, availableA1=1, and the motion information of thePU positioned in (xA1, yA1) and the motion information positioned in(xN, yN) are the same as each other.

(10) As the process of determining the similarity of the motioninformation, N is B2, availableB1=1, and the motion information of thePU positioned in (xB1, yB1) and the motion information positioned in(xN, yN) are the same as each other.

Otherwise, availableFlagN is set to ‘1’, and mvLX[xN, yN], refIdxLX[xN,yN], and predFlagLX[xN, yN] are set to mvLXN, refIdxLXN, predFlagLXN,respectively.

[3] availableFlagN (herein, N=B2) of B2 is derived later than A0, A1,B0, and B1. The process for determining whether the neighboring PU(spatial PU) of the current PU is usable as the merge motion candidateadopts a content below. Herein, (xB2, yB2) may be replaced with (xC−1,yC−1).

[3-1] The process of determining whether the neighboring PU is availableis performed, and herein, the inputs are (xC, yC), (xP, yP), nPbW, nPbH,(xB2, yB2), and partIdx and the output is the availability informationof the PU positioned in (xB2, yB2), availableB2.

[3-2] If the following conditions is ‘true’, availableFlagB2 is set to‘0’ and mvLXB2 is set to ‘0.0’.

availableFlagA0+availableFlagA1+availableFlagB0+availableFlagB1 is equalto ‘4’.

Otherwise, availableFlagB2 is set to ‘1’, and mvLX[xB2, yB2],refIdxLX[xB2, yB2], and predFlagLX[xB2, yB2] are set to mvLXB2,refIdxLXB2, and predFlagLXB2, respectively.

The step of setting the merge motion candidate from the neighboring PU(spatial PU) of the current PU of the method 1 may be modified as belowaccording to yet another example of the present invention.

[1] An input in the step of setting the merge motion candidate from theneighboring PU (spatial PU) of the current PU will be described below.

(xC yC): the left top position of the current coding unit (CU) block;

(xP, yP): the left top position of the current PU;

(nCS): a variable indicating the size of the current CU;

(nPSW, nPSH): a variable indicating the width and the height of thecurrent PU;

singleMCLFlag: a variable indicating whether a common merge candidatelist for the current CU is usable;

an index of the current PU within the current CU block; (partIdx)

An output in this step will be described below. (Herein, N may bereplaced with A1, B1, B0, A0, and B2 of FIG. 12 and X may be replacedwith ‘0’ or ‘1’.)

availableFlagN: a variable indicating whether motion information of aneighboring PU N is available;

refIdxLXN: a reference index of the neighboring PU N;

predFlagLXN: a variable indicating whether a prediction list for theneighboring PU N is usable;

mvLXN: a motion vector for the neighboring PU N

[2] The process for determining whether the neighboring PU (spatial PU)of the current PU is usable as the merge motion candidate is performedin the order of the A1, B1, B0, A0, and B2 according to the leftpriority deciding method. Herein, the neighboring PU represents A1, B1,B0, A0, and B2 of FIG. 12, N may be replaced with A1, B1, B0, A0, and B2of FIG. 12, and (xN, yN) may be replaced with (xC−1, yC+nCS), (xC−1,yC+nCS−1), (xC+nCS, yC−1), (xC+nCS−1, yC−1), and (xC−1, yC−1).

[2-1] The process of determining whether the neighboring PU is availableis performed, and herein, the inputs are (xC, yC), (xP, yP), nPbW, nPbH,(xN, yN), and partIdx and the output is the availability information ofthe PU positioned in (xN, yN), availableN.

[2-2] If even one of the following conditions (1) to (10) is ‘true’,availableFlagN is set to ‘0’ and mvLXN is set to ‘0,0’.

(1) (xP>>(log 2_parallel_merge_level_minus2+2)) is the same as (xN>>(log2_parallel_merge_level_minus2+2)) and (yP>>(log2_parallel_merge_level_minus2+2)) is the same as (yN>>(log2_parallel_merge_level_minus2+2)).

(2) N is B1, andavailableFlagA0+availableFlagA1+availableFlagB0+availableFlagB1 is ‘4’.

(3) The PU positioned at [xN, yN] is disabled or encoded intra. That is,availableN is ‘0’.

(4) singleMCLFlag is ‘0’, the partition form of the current PU isPART_2N×N, PART_2N×nU, or PART_2N×nD, PartIdx is ‘1’, and N is ‘131’.

(5) singleMCLFlag is ‘0’, the partition form of the current PU isPART_N×2N, PART_nL×2N, or PART_nR×2N, PartIdx is ‘1’, and N is ‘A1’.

(6) As the process of determining the similarity of the motioninformation, N is equal to B1, and the motion information of the PUpositioned in (xA1, yA1) and the motion information positioned in (xN,yN) are the same as each other.

(7) As the process of determining the similarity of the motioninformation, N is B0, and the motion information of the PU positioned in(xB1, yB1) and the motion information positioned in (xN, yN) are thesame as each other.

(8) As the process of determining the similarity of the motioninformation, N is A0, and the motion information of the PU positioned in(xA1, yA1) and the motion information positioned in (xN, yN) are thesame as each other.

(9) As a process of determining the similarity of the motioninformation, N is B2, and the motion information of the PU positioned in(xA1, yA1) and the motion information positioned in (xN, yN) are thesame as each other.

(10) As the process of determining the similarity of the motioninformation, N is B2, and the motion information of the PU positioned in(xB1, yB1) and the motion information positioned in (xN, yN) are thesame as each other.

Otherwise, availableFlagN is set to ‘1’, and mvLX[xN, yN], refIdxLX[xN,yN], and predFlagLX[xN, yN] are set to mvLXN, refIdxLXN, predFlagLXN,respectively.

Application ranges of all of the aforementioned methods may be changeddepending on the size of the block or the depth of the CU. An encoder ora decoder may be set to use predetermined values as the variables (thatis, the size or depth information) for deciding the application range,use a predetermined value according to a profile or a level, and whenthe encoder writes a variable value in a bitstream, the decoder derivesthe variable value from the bitstream to be used.

When the application range is changed depending on the depth of the CU,a method (A) applied to only a predetermined depth or more, a method (B)applied to only the predetermined depth, and a method (C) applied toonly the predetermined depth may be used, as illustrated in Table 1below.

TABLE 1 CU depth indicating application range Method A Method B Method C0 X ◯ X 1 X ◯ X 2 ◯ ◯ ◯ 3 ◯ X X 4 ◯ X X

“0” of Table 1 represents a case in which the method of determiningwhether the motion information is available is applied to thecorresponding depth and “X” represent a case in which the method ofdetermining whether the motion information is available is not appliedto the corresponding depth.

Referring to Table 1, all of the aforementioned methods may be appliedto a case in which the CU depth is 2. Table 1 illustrates one exampleand may be modified.

In the aforementioned embodiments, methods have been described based onflowcharts as a series of steps or blocks, but the methods are notlimited to the order of the steps of the present invention and any stepmay occur in a step or an order different from or simultaneously as theaforementioned step or order. Further, it can be appreciated by thoseskilled in the art that steps shown in the flowcharts are not exclusiveand other steps may be included or one or more steps do not influencethe scope of the present invention and may be deleted.

The aforementioned embodiments include examples of various aspects. Allavailable combinations for expressing various aspects cannot bedescribed, but it can be recognized by those skilled in the art thatother combinations can be used. Therefore, all other substitutions,modifications, and changes of the present invention that belong to theappended claims can be made.

The invention claimed is:
 1. A video decoding method, comprising:deriving information for block availability of a first neighboring blockfor a current block; deriving information for motion informationavailability of the first neighboring block of the current block basedon the information for block availability of the first neighboringblock, and motion information of the first neighboring block;constructing a merge candidate list for the current block based on thederived information for motion information availability of the firstneighboring block; determining motion information of the current blockbased on the merge candidate list; and obtaining prediction samples ofthe current block by using the motion information of the current block,wherein the deriving information for block availability of the firstneighboring block comprises: in a Z-scan availability process, derivingthe information for block availability of the first neighboring blockbased on whether slice information and tile information of the firstneighboring block are equal to slice information and tile information ofthe current block; in the availability derivation process for the firstneighboring block, derive the information for block availability of thefirst neighboring block based on whether a prediction mode of the firstneighboring block is an inter prediction mode or not; and in a step ofsetting the merge candidate from neighboring blocks of the currentblock, resetting the derived information for block availability of thefirst neighboring block based on parallel merge level informationindicating a size of a block in which a parallel merge processing isapplicable, wherein the information for motion information availabilityof the first neighboring block is derived using information for blockavailability of a second neighboring block whose information for blockavailability is derived earlier than the first neighboring block, andcomparison between the motion information of the first neighboring blockand motion information of the second neighboring block, and wherein theinformation for block availability indicates whether a correspondingneighboring block is usable for an inter prediction of the current blockand the information for motion information availability indicateswhether motion information of the corresponding neighboring block isincluded in the merge candidate list.
 2. A video encoding method,comprising: determining motion information of a current block; obtainingprediction samples of the current block; deriving information for blockavailability of a first neighboring block for the current block;deriving information for motion information availability of the firstneighboring block of the current block based on the information forblock availability of the first neighboring block and motion informationof the first neighboring block; and constructing a merge candidate listfor the current block based on the derived information for motioninformation availability of the first neighboring block, wherein thederiving information for block availability of the first neighboringblock comprises: in a Z-scan availability process, deriving theinformation for block availability of the first neighboring block basedon whether slice information and tile information of the firstneighboring block are equal to slice information and tile information ofthe current block; in the availability derivation process for the firstneighboring block, derive the information for block availability of thefirst neighboring block based on whether a prediction mode of the firstneighboring block is an inter prediction mode or not; and in a step ofsetting the merge candidate from neighboring blocks of the currentblock, resetting the derived information for block availability of thefirst neighboring block based on parallel merge level informationindicating a size of a block in which a parallel merge processing isapplicable, and wherein the information for motion informationavailability of the first neighboring block is derived using informationfor block availability of a second neighboring block whose informationfor block availability is derived earlier than the first neighboringblock, and comparison between the motion information of the firstneighboring block and motion information of the second neighboringblock, and wherein the information for block availability indicateswhether a corresponding neighboring block is usable for an interprediction of the current block and the information for motioninformation availability indicates whether motion information of thecorresponding neighboring block is included in the merge candidate list.3. A non-transitory recording medium storing a bitstream formed by amethod of encoding a video, the method comprising: determining motioninformation of a current block; obtaining prediction samples of thecurrent block; deriving information for block availability of a firstneighboring block for the current block; deriving information for motioninformation availability of the first neighboring block of the currentblock based on the information for block availability of the firstneighboring block, and motion information of the first neighboringblock; and constructing a merge candidate list for the current blockbased on the derived information for motion information availability ofthe first neighboring block, wherein the deriving information for blockavailability of the first neighboring block comprises: in a Z-scanavailability process, deriving the information for block availability ofthe first neighboring block based on whether slice information and tileinformation of the first neighboring block are equal to sliceinformation and tile information of the current block; in theavailability derivation process for the first neighboring block, derivethe information for block availability of the first neighboring blockbased on whether a prediction mode of the first neighboring block is aninter prediction mode or not; and in a step of setting the mergecandidate from neighboring blocks of the current block, resetting thederived information for block availability of the first neighboringblock based on parallel merge level information indicating a size of ablock in which a parallel merge processing is applicable, wherein theinformation for motion information availability of the first neighboringblock is derived using information for block availability of a secondneighboring block whose information for block availability is derivedearlier than the first neighboring block, and comparison between themotion information of the first neighboring block and motion informationof the second neighboring block, and wherein the information for blockavailability indicates whether a corresponding neighboring block isusable for an inter prediction of the current block and the informationfor motion information availability indicates whether motion informationof the corresponding neighboring block is included in the mergecandidate list.